package com.yaowk.service.mall.clothing.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

/**
 * 商品图片
 */
@Setter
@Getter
@Entity
public class CmGoodsImage implements Comparable<CmGoodsImage> {

    @EmbeddedId
    private CmGoodsImageId id;
    @Column(nullable = false)
    private Byte sort;

    @Override
    public int compareTo(CmGoodsImage cmGoodsImage) {
        return sort.compareTo(cmGoodsImage.getSort());
    }
}
